
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2450. -- 构造数组 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2450: 构造数组</h2><span class=green>Time Limit: </span>20 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>256 MB<br><span class=green>Submit: </span>5&nbsp;&nbsp;<span class=green>Solved: </span>0<br>[<a href='submitpage.php?id=2450'>Submit</a>][<a href='problemstatus.php?id=2450'>Status</a>][<a href='bbs.php?id=2450'>Discuss</a>]</center><h2>Description</h2><div class=content><div style="text-indent: 21pt"><span style="font-size: 12pt">给出</span><span style="font-size: 12pt">3*n</span><span style="font-size: 12pt">个数</span><span style="font-size: 12pt">xi</span><span style="font-size: 12pt">，要求构造三个长度为</span><span style="font-size: 12pt">n</span><span style="font-size: 12pt">的序列</span><span style="font-size: 12pt">ai</span><span style="font-size: 12pt">，</span><span style="font-size: 12pt">bi</span><span style="font-size: 12pt">，</span><span style="font-size: 12pt">ci</span><span style="font-size: 12pt">，使得满足下列条件：</span></div>
<div style="text-indent: 21pt"><span style="font-size: 12pt">1</span><span style="font-size: 12pt">到</span><span style="font-size: 12pt">3*n</span><span style="font-size: 12pt">的每个数都在三个序列中的某个出现一次且仅一次；</span></div>
<div style="text-indent: 21pt"><span style="font-size: 12pt">S=sum((x[ai]-x[bi])*x[ci])</span><span style="font-size: 12pt">最大。</span></div>
<div style="text-indent: 21pt"><span style="font-size: 12pt">输出最大的</span><span style="font-size: 12pt">S</span><span style="font-size: 12pt">。</span></div>
<div style="text-indent: 21pt"><span style="font-size: 12pt">多组数据。</span></div></div><h2>Input</h2><div class=content><div style="text-indent: 21pt"><span style="font-size: 10.5pt">第一行包含两个数</span><span style="font-size: 10.5pt">T</span><span style="font-size: 10.5pt">和</span><span style="font-size: 10.5pt">n</span><span style="font-size: 10.5pt">，</span><span style="font-size: 10.5pt">T</span><span style="font-size: 10.5pt">是数据组数，</span><span style="font-size: 10.5pt">n</span><span style="font-size: 10.5pt">如题目描述。</span></div>
<div style="text-indent: 21pt"><span style="font-size: 10.5pt">接下来</span><span style="font-size: 10.5pt">T</span><span style="font-size: 10.5pt">行，每行包含</span><span style="font-size: 10.5pt">3*n</span><span style="font-size: 10.5pt">个数，表示</span><span style="font-size: 10.5pt">xi</span><span style="font-size: 10.5pt">。</span></div>
<div style="text-indent: 21pt">&nbsp;</div></div><h2>Output</h2><div class=content><div style="text-indent: 21pt"><span style="font-size: 10.5pt">输出包含</span><span style="font-size: 10.5pt">T</span><span style="font-size: 10.5pt">行，每行输出最大的</span><span style="font-size: 10.5pt">S</span><span style="font-size: 10.5pt">。</span></div>
<div style="text-indent: 21pt">&nbsp;</div></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>1 2<br />
4 1 8 2 0 5<br />
<br />
 <br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>46<br />
  <br />
 </span></div><h2>HINT</h2>
			<div class=content><p><p><br /><br />
Data Limit<br /><br />
对于1&lt;=n&lt;=10，有不超过1000组数据；<br /><br />
对于11&lt;=n&lt;=15，又不超过100组数据；<br /><br />
对于16&lt;=n&lt;=20，有不超过10组数据；<br /><br />
对于21&lt;=n&lt;=25，仅有1组数据。<br /><br />
所有xi&lt;=1000。<br /><br />
</p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=2011福建集训'>2011福建集训</a></p></div><center>[<a href='submitpage.php?id=2450'>Submit</a>][<a href='problemstatus.php?id=2450'>Status</a>][<a href='bbs.php?id=2450'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
